package export.bullet
{
    import base.BaseBullet;
    import base.BaseObject;
    
    import flash.display.Sprite;
    
    public class RegionBullet extends BaseBullet
    {
        public function RegionBullet()
        {
            super();
            setIsDestroyWhenOwnerHurt(true);
            setIsDestroyWhenLastFrame(false);
        }
        
        override public function renderAnimate():void
        {
            CONFIG::DEBUG{
                if(gc.debugParam.displayAttackRegion)
                {
                    graphics.clear();
                    graphics.beginFill(0x00FF00,0.5);
                    graphics.drawRect(collideBox.x,collideBox.y,collideBox.width,collideBox.height);
                    graphics.endFill();
                }
            }
            x = owner.x;
            y = owner.y;
            super.renderAnimate();
        }
        
        override public function setCollideArea(x:Number = 0, y:Number = 0, w:Number = 0, h:Number = 0):void
        {
            super.setCollideArea(x,y,w,h);
        }
        
        override public function setDirect(value:int):void
        {
            direct = value;
        }
        
        override public function setOwner(owner:BaseObject):void
        {
            super.setOwner(owner);
            x = owner.x;
            y = owner.y;
        }
    }
}
